
const { apiPreFix } = require('../config').server
const comment = require('../controllers/comment')
module.exports = (router) => {
  /**
   * 添加评论
   */
  router.post(`${apiPreFix}/comment/addComment`, async ctx => {
    await comment.addComment(ctx)
  })
  /**
   * 评论列表
   */
  router.get(`${apiPreFix}/comment/commentList`, async ctx => {
    await comment.commentList(ctx)
  })
  /**
   * 评论列表
   */
  router.get(`${apiPreFix}/comment/commentDetail`, async ctx => {
    await comment.commentDetail(ctx)
  })
  /**
   * 添加回复
   */
  router.post(`${apiPreFix}/comment/addReply`, async ctx => {
    await comment.addReply(ctx)
  })
  /**
   * 回复列表
   */
  router.get(`${apiPreFix}/comment/replyList`, async ctx => {
    await comment.replyList(ctx)
  })
}